//#include<bits/stdc++.h>
//using namespace std;
/*int main() {
	char s1[550], s2[550];
	int arr1[550] = { 0 }, arr2[550] = { 0 }, arr3[550] = { 0 };
	int la, lb, lc;
	scanf("%s %s", &s1, &s2);
	la = strlen(s1);
	lb = strlen(s2);
	for (int i = 0; i < la; i++) {
		arr1[la - i] = s1[i] - '0'; 
	}
	for (int i = 0; i < lb; i++) {
		arr2[lb - i] = s2[i] - '0';
	}
	lc = max(la, lb) + 1;
	for (int i = 1; i <= lc; i++) {
		arr3[i] += arr1[i] + arr2[i];
		arr3[i] %= 10;
		arr3[i + 1] += arr3[i] / 10;
	}
	while (lc > 1 && arr3[lc] == 0) {
		lc--;
	}
	for (int i = 1; i <= lc; i++) {
		printf("%d", arr3[i]);
	}


	return 0;
}
*/
#include<bits/stdc++.h>
using namespace std;
bool my_size(int la, int lb, char* s1, char* s2){
	if (la == lb){
		return strcmp(s2,s1) >= 0;
	}
	else{
		return la < lb;
	}
}
int main(){
	char s1[550] = { 0 }, s2[550] = { 0 }, s3[550] = { 0 };
	int a[550] = { 0 }, b[550] = { 0 }, c[550] = { 0 };
	int la, lb, lc, faly = 0;
	scanf("%s %s", &s1, &s2);
	la = strlen(s1);
	lb = strlen(s2);
	if(my_size(la,lb,s1,s2)){
		strcpy(s3,s1);
		strcpy(s1,s2);
		strcpy(s2,s1);
		faly = 1;
		lc = lb;
		lb = la;
		la = lc;
	}
	for (int i = 0; i < la; i++){
		a[la - i] = s1[i] - '0';
	}
	for (int i = 0; i < lb; i++){
		b[lb - i] = s2[i] - '0';
	}
	lc = la > lb ? la : lb;
	for (int i = 1; i <= lc; i++){
		if (a[i] < b[i]){
			a[i + 1]--;
			a[i] += 10;
		}
		c[i] = a[i] - b[i];
	}
	while(lc > 1 && c[lc] == 0){
		lc--;
	}
	if (faly == 1){
		printf("-");
	}
	for (int i = lc; i > 0; i--){
		printf("%d", c[i]);
	}
	return 0;
}

